<?php


    //前端页面
    Route::get('/', 'Home\\IndexController@index');
    Route::get('/post/{id}', 'Home\\IndexController@post');//与administrator 冲突了
    Route::get('/posts', 'Home\\IndexController@posts');

    //后台管理
    Route::group(['middleware'=>'admin.auth'],function(){
        Route::get('/administrator', 'Admin\\AdministratorController@index');
        //文章管理
        Route::get('/administrator/post', 'Admin\\PostController@index');
        Route::post('/administrator/post', 'Admin\\PostController@store');
        Route::get('/administrator/post/create', 'Admin\\PostController@create');
        Route::get('/administrator/post/{id}/edit', 'Admin\\PostController@edit');
        Route::post('/administrator/post/{id}', 'Admin\\PostController@update');
        Route::get('/administrator/post/{id}/delete','Admin\\PostController@delete');

        //文章分类管理
        Route::get('/administrator/postCid', 'Admin\\PostCidController@index');
        Route::post('/administrator/postCid', 'Admin\\PostCidController@store');
        Route::get('/administrator/postCid/create', 'Admin\\PostCidController@create');
        Route::get('/administrator/postCid/{id}/edit', 'Admin\\PostCidController@edit');
        Route::post('/administrator/postCid/{id}', 'Admin\\PostCidController@update');
        Route::get('/administrator/postCid/{id}/delete','Admin\\PostCidController@delete');

        //菜单管理
        Route::get('/administrator/menu', 'Admin\\MenuController@index');
        Route::post('/administrator/menu', 'Admin\\MenuController@store');
        Route::get('/administrator/menu/create', 'Admin\\MenuController@create');
        Route::get('/administrator/menu/{id}/edit', 'Admin\\MenuController@edit');
        Route::post('/administrator/menu/{id}', 'Admin\\MenuController@update');
        Route::get('/administrator/menu/{id}/delete','Admin\\MenuController@delete');

        //配置管理
        Route::get('/administrator/config', 'Admin\\ConfigController@index');
        Route::post('/administrator/config', 'Admin\\ConfigController@store');
        Route::get('/administrator/config/create', 'Admin\\ConfigController@create');
        Route::get('/administrator/config/{id}/edit', 'Admin\\ConfigController@edit');
        Route::post('/administrator/config/{id}', 'Admin\\ConfigController@update');
        Route::get('/administrator/config/{id}/delete','Admin\\ConfigController@delete');

    });
    Route::any('/administrator/signIn', 'Admin\\AdministratorController@signIn');
    Route::get('/administrator/signOut', 'Admin\\AdministratorController@signOut');







//需要跳转微信的页面
Route::group(['middleware' => 'wechat.oauth'], function () {


});


//微信
Route::any('/callbacks/wechat', 'CallbackController@listenToWechat');
Route::any('/callbacks/payments/yunpay/notify', 'CallbackController@listenToYunpay');
Route::any('/callbacks/payments/yunpay/return', 'CallbackController@listenToYunpayReturn');

Route::get('/test', 'TestController@run');
